/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author mauriciomonsanto
 */
public class QuickSort 
{

    private static int QuickSort (int data[], int left, int right)
            //Ppre: left<=right
            //post:data[left] placed in the correct (returned) locations
            
    {
        while (true)
        {
            //move right "pointer toward left
            while (left<right && data[left]<data[right])right--;
            if (left<right) swap(data,left ++,right);
                    else return left;
            //move left pointer toward right
            while (left<right && data[left]<data[right])left--;
            if(left<right) swap(data, left, right--);
            else return right;
            
            
        }
    }

    private static void swap(int[] data, int i, int right) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
            
    
    
        
    }
    
    
